/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Main;

import java.io.PrintStream;

/**
 *
 * @author Daniel
 */
public class Send implements Runnable{
    private final DTrem trem;
    private final PrintStream saida;
    
    /**
     *
     * @param trem
     * @param saida
     */
    public Send(DTrem trem, PrintStream saida){
        this.trem = trem;
        this.saida = saida;
    }

    @Override
    public void run() {
        //envia dados
        while(true)
            saida.println(trem.getInfo());
    }
}
